import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/discoverMusic',
      name: 'discoverMusic',
      component: () => import('../views/discoverMusic/index.vue'),
      children:[
        {
          path:'newestSongs',
          component:()=> import ("../views/discoverMusic/NewestSongs.vue")
        },
        {
          path:'singer',
          component:()=> import ("../views/discoverMusic/Singer.vue")
        },
        {
          path:'ranking',
          component:()=> import ("../views/discoverMusic/Ranking.vue")
        },
        {
          path:'songList',
          component:()=> import ("../views/discoverMusic/SongList.vue")
        }
      ]
    },
    {
      path: '/songListContent',
      name: 'songListContent',
      component: () => import('../views/songListContent.vue')
    },
    {
      path:'/singer',
      name:'singer',
      component:() => import('../views/singerPage/index.vue'),
      children:[
        {
          path:'choiceness',
          component:()=>import ('../views/singerPage/Choiceness.vue')
        },
        {
          path:'album',
          component:()=>import('../views/singerPage/Album.vue')
        },
        {
          path:'mv',
          component:()=>import ('../views/singerPage/MV.vue')
        },
        {
          path:'details',
          component:()=>import ('../views/singerPage/Details.vue')
        }
      ]
    },
    {
      path:'/mvplay',
      name:'mvplay',
      component:()=>import('../views/MVPlayPage.vue')
    },{
      path:'/search',
      name:'search',
      component:()=>import('../views/searchPage/index.vue'),
      children:[
        {
          path:'song',
          component:()=>import ('../views/searchPage/song.vue')
        },{
          path:'mv',
          component:()=>import ('../views/searchPage/mv.vue')
        },{
          path:'album',
          component:()=>import("../views/searchPage/Album.vue")
        },{
          path:'singer',
          component:()=>import('../views/searchPage/singer.vue')
        },{
          path:'songList',
          component:()=>import('../views/searchPage/songList.vue')
        }
      ]
    },{
      path:"/album",
      name:'album',
      component:()=> import('../views/Album.vue')
    },
    {
      path:'/video',
      component:()=>import ('../views/video.vue')
    }
  ]
})

export default router
